W32: support cairo library in non-standard locations
authorРуслан Ижбулатов <lrn1986@gmail.com>
Fri, 29 Apr 2016 15:54:52 +0000 (15:54 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Fri, 29 Apr 2016 15:56:54 +0000 (15:56 +0000)
When checking for cairo_win32_surface_create_with_format in -lcairo,
temporarily put CAIRO_LIBS into LIBS so that AC_CHECK_LIB() can
find it in weird places like /usr/local/lib, where gcc would not look
on its own.

https://bugzilla.gnome.org/show_bug.cgi?id=765793

configure.ac

index e1f743de445e28d110102f83db9dac3abebb8be8..3718dbf89870f41de9cdea715a539c74d60b9ed8 100644 (file)
@@ -581,18 +581,21 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
 PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
 
 # Remove this check once cairo_required_version reaches at least 1.16.0
-case $host_os in
-  mingw*)
+AS_CASE([$host_os],
+  [mingw*],
+  [
     PKG_CHECK_MODULES(CAIRO, [cairo >= cairo_required_version])
+    gtk_save_LIBS="$LIBS"
+    LIBS="$CAIRO_LIBS $LIBS"
     AC_CHECK_LIB([cairo], [cairo_win32_surface_create_with_format],
       [AC_MSG_RESULT([found])],
       [AC_MSG_ERROR(
 [cairo_win32_surface_create_with_format is not found in cairo library
 You need a cairo snapshot 1.15.x or 1.16.x release or newer])])
-    ;;
-  *)
-    ;;
-esac
+    LIBS="$gtk_save_LIBS"
+  ],
+  []
+)
 
 
 PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])